<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教育智能AI平台</title>
    <!-- 引入TDesign样式 -->
    <link rel="stylesheet" href="css/tdesign.css">
    <!-- 引入Vue 3 -->
    <script src="js/vue.global.js"></script>
    <!-- 引入TDesign Vue组件 -->
    <script src="js/tdesign-vue-next.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }
        
        .login-wrapper {
            display: flex;
            width: 100%;
            max-width: 1000px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 82, 217, 0.12);
            overflow: hidden;
        }
        
        .login-left {
            flex: 1;
            background: linear-gradient(135deg, #0052d9 0%, #1d7dfa 100%);
            color: white;
            padding: 60px 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .login-left h1 {
            font-size: 32px;
            margin-bottom: 20px;
            font-weight: 600;
        }
        
        .login-left p {
            font-size: 16px;
            line-height: 1.6;
            opacity: 0.9;
        }
        
        .login-right {
            flex: 1;
            padding: 60px 50px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .logo-section {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .logo {
            width: 70px;
            height: 70px;
            background-color: #0052d9;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 28px;
            font-weight: bold;
            margin-bottom: 20px;
            box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
        }
        
        .logo-section h1 {
            font-size: 28px;
            color: #1d2129;
            margin-bottom: 10px;
        }
        
        .logo-section p {
            color: #86909c;
            font-size: 15px;
        }
        
        .form-group {
            margin-bottom: 24px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #1d2129;
            font-size: 15px;
            font-weight: 500;
        }
        
        .form-control {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid #e5e6eb;
            border-radius: 6px;
            font-size: 15px;
            transition: all 0.2s ease;
        }
        
        .form-control:focus {
            border-color: #0052d9;
            box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1);
            outline: none;
        }
        
        .form-control.error {
            border-color: #e34d59;
        }
        
        .error-message {
            color: #e34d59;
            font-size: 13px;
            margin-top: 6px;
            display: none;
        }
        
        .error-message.show {
            display: block;
        }
        
        .remember-forgot {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            font-size: 14px;
        }
        
        .remember-me {
            display: flex;
            align-items: center;
        }
        
        .remember-me input {
            margin-right: 8px;
            width: 16px;
            height: 16px;
        }
        
        .forgot-password {
            color: #0052d9;
            text-decoration: none;
            transition: color 0.2s ease;
            font-weight: 500;
        }
        
        .forgot-password:hover {
            color: #1d7dfa;
        }
        
        .login-button {
            width: 100%;
            padding: 14px;
            background-color: #0052d9;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
        }
        
        .login-button:hover {
            background-color: #1d7dfa;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0, 82, 217, 0.4);
        }
        
        .login-button:active {
            background-color: #003eb3;
            transform: translateY(0);
        }
        
        .login-button:disabled {
            background-color: #bbd3fb;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        
        .divider {
            text-align: center;
            margin: 35px 0;
            position: relative;
            color: #86909c;
            font-size: 14px;
        }
        
        .divider::before {
            content: "";
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 1px;
            background-color: #e5e6eb;
            z-index: 1;
        }
        
        .divider span {
            background-color: white;
            padding: 0 15px;
            position: relative;
            z-index: 2;
        }
        
        .social-login {
            display: flex;
            justify-content: center;
            gap: 20px;
        }
        
        .social-button {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f6f7f8;
            border: 1px solid #e5e6eb;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .social-button:hover {
            background-color: #f0f2f5;
            transform: translateY(-3px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        .social-button img {
            width: 22px;
            height: 22px;
        }
        
        .register-link {
            text-align: center;
            margin-top: 30px;
            font-size: 15px;
            color: #86909c;
        }
        
        .register-link a {
            color: #0052d9;
            text-decoration: none;
            margin-left: 5px;
            transition: color 0.2s ease;
            font-weight: 500;
        }
        
        .register-link a:hover {
            color: #1d7dfa;
        }
        
        @media (max-width: 768px) {
            .login-wrapper {
                flex-direction: column;
                max-width: 500px;
            }
            
            .login-left {
                padding: 40px 30px;
            }
            
            .login-right {
                padding: 40px 30px;
            }
        }
        
        @media (max-width: 480px) {
            .login-wrapper {
                border-radius: 8px;
            }
            
            .login-left, .login-right {
                padding: 30px 20px;
            }
            
            .logo-section h1 {
                font-size: 24px;
            }
            
            .social-login {
                gap: 15px;
            }
        }
        
        .feature-list {
            margin-top: 30px;
        }
        
        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            font-size: 15px;
        }
        
        .feature-icon {
            margin-right: 12px;
            width: 20px;
            height: 20px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="login-wrapper">
            <div class="login-left">
                <h1>教育智能AI平台</h1>
                <p>基于LLM大模型的智能教育AI平台，提供一致、高效、优质的用户体验。</p>
                
                <div class="feature-list">
                    <div class="feature-item">
                        <div class="feature-icon">✓</div>
                        <span>教学效率提升</span>
                    </div>
                    <div class="feature-item">
                        <div class="feature-icon">✓</div>
                        <span>学习效果优化</span>
                    </div>
                    <div class="feature-item">
                        <div class="feature-icon">✓</div>
                        <span>数据驱动决策</span>
                    </div>
                    <div class="feature-item">
                        <div class="feature-icon">✓</div>
                        <span>个性化教学</span>
                    </div>
                </div>
            </div>
            
            <div class="login-right">
                <div class="logo-section">
                    <div class="logo">T</div>
                    <h1>欢迎登录</h1>
                </div>
                
                <form @submit.prevent="handleSubmit">
                    <div class="form-group">
                        <label for="username">用户名</label>
                        <input 
                            type="text" 
                            id="username" 
                            class="form-control" 
                            :class="{ 'error': errors.username }"
                            v-model="form.username" 
                            placeholder="请输入用户名"
                            @blur="validateField('username')"
                        >
                        <div class="error-message" :class="{ 'show': errors.username }">{{ errors.username }}</div>
                    </div>
                    
                    <div class="form-group">
                        <label for="password">密码</label>
                        <input 
                            type="password" 
                            id="password" 
                            class="form-control" 
                            :class="{ 'error': errors.password }"
                            v-model="form.password" 
                            placeholder="请输入密码"
                            @blur="validateField('password')"
                        >
                        <div class="error-message" :class="{ 'show': errors.password }">{{ errors.password }}</div>
                    </div>
                    
                    <div class="remember-forgot">
                        <div class="remember-me">
                            <input type="checkbox" id="remember" v-model="form.remember">
                            <label for="remember">记住我</label>
                        </div>
                        <a href="#" class="forgot-password">忘记密码?</a>
                    </div>
                    
                    <button type="submit" class="login-button" :disabled="loading">
                        <span v-if="!loading">登录</span>
                        <span v-else>登录中...</span>
                    </button>
                </form>
            </div>
        </div>
    </div>

    <script>
        const { createApp, ref, reactive } = Vue;
        
        createApp({
            setup() {
                const form = reactive({
                    username: '',
                    password: '',
                    remember: false
                });
                
                const errors = reactive({
                    username: '',
                    password: ''
                });
                
                const loading = ref(false);
                
                const validateField = (field) => {
                    if (field === 'username') {
                        if (!form.username.trim()) {
                            errors.username = '请输入用户名';
                        } else {
                            errors.username = '';
                        }
                    } else if (field === 'password') {
                        if (!form.password) {
                            errors.password = '请输入密码';
                        } else if (form.password.length < 6) {
                            errors.password = '密码长度不能少于6位';
                        } else {
                            errors.password = '';
                        }
                    }
                };
                
                const handleSubmit = () => {
                    validateField('username');
                    validateField('password');
                    
                    if (errors.username || errors.password) {
                        return;
                    }
                    
                    loading.value = true;
                    
                    // 模拟登录请求
                    setTimeout(() => {
                        loading.value = false;
                        alert(`登录成功！\n用户名: ${form.username}\n记住我: ${form.remember ? '是' : '否'}`);
                    }, 1500);
                };
                
                const socialLogin = (platform) => {
                    alert(`正在通过${platform === 'wechat' ? '微信' : platform === 'qq' ? 'QQ' : 'GitHub'}登录`);
                };
                
                return {
                    form,
                    errors,
                    loading,
                    validateField,
                    handleSubmit,
                    socialLogin
                };
            }
        }).mount('#app');
    </script>
</body>
</html>